unit U_fm_loc_nota;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.Buttons;

type
  Tfm_loc_nota = class(TForm)
    BitBtn1: TBitBtn;
    GroupBox1: TGroupBox;
    Edit1: TEdit;
    Label1: TLabel;
    procedure BitBtn1Click(Sender: TObject);
    procedure FormShow(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  fm_loc_nota: Tfm_loc_nota;

implementation

{$R *.dfm}

uses U_dm_principal;

procedure Tfm_loc_nota.BitBtn1Click(Sender: TObject);
begin
dm_principal.cds_saida.Close;
       dm_principal.sq_saida.SQL.Text:='select s.cliente,'
            +#13+'s. vendedor,'
            +#13+'s.tipo_mov, '
            +#13+'s.data_mov,'
            +#13+'s.hora_mov, '
            +#13+'s.tipo_pag,'
            +#13+'s.n_nfe,'
            +#13+'s.forma_pag'
            +#13+'from saida s'
            +#13+' where s.n_nfe <> 0 ';
         if  length(trim(Edit1.Text))>0 then
             dm_principal.sq_saida.SQL.Add(' and  n_nfe containing '+QuotedStr(Edit1.Text));
             dm_principal.cds_saida.Open;
             dm_principal.cds_item.Open;
end;

procedure Tfm_loc_nota.FormShow(Sender: TObject);
begin
dm_principal.cds_saida.Open;
dm_principal.cds_item.Open;
end;

end.
